<extend name="Base/mob_common"/>
<block name="mob_bottom">
    <div data-am-widget="navbar" class="am-navbar am-navbar-default am-cf " id="">
        <ul class="am-navbar-nav am-cf am-avg-sm-4" style="padding: 0px;font-size: 13px;background: #32b1f1">
            <li
            <if condition="($_GET['mark'] eq '0') or($_GET['mark'] eq '')">style="background: #0f9ae0"</if>
            >
            <a style="color: white" href="{:U('Mob/Question/index',array('mark'=>0))}">
                待回答
            </a>
            </li>
            <li
            <if condition="($_GET['mark'] eq '1')">style="background: #0f9ae0"</if>
            >
            <a style="color: white" href="{:U('Mob/Question/index',array('mark'=>1))}">
                热门问题
            </a>
            </li>
            <li
            <if condition="($_GET['mark'] eq '2')">style="background: #0f9ae0"</if>
            >
            <a style="color: white" href="{:U('Mob/Question/index',array('mark'=>2))}">
                我的问答
            </a>
            </li>
            <li
            <if condition="($_GET['mark'] eq '3')">style="background: #0f9ae0"</if>
            >
            <a style="color: white" id="Q-type">
                分类
            </a>

            </li>
        </ul>
    </div>

</block>
<block name="mob_body">
    <script src="__JS__/question.js"></script>
    <link rel="stylesheet" href="__CSS__/apps/question.css"/>
    <div id="Q-list">
        <ul>
            <li>
              <a href="{:U('Mob/Question/index',array('mark'=>3))}">全部问题</a>
            </li>
            <volist name="parent" id="type">
              <php>if(!empty($type['child'])){</php>
                    <li><span class="triangle-left">
                        </span>
                       {$type.title}
                        <div class="Q-list-sec">
                            <div class="sec">
                                <ul>
                                    <li>
                                      <a href="{:U('Mob/Question/index',array('mark'=>parentType,'typeId'=>$type['id']))}"> 全部</a>
                                    </li>
                                    <volist name="type.child" id="child_cate">
                                        <li>
                                         <a href="{:U('Mob/Question/index',array('mark'=>childType,'typeId'=>$child_cate['id']))}">  {$child_cate.title}</a>
                                        </li>
                                    </volist>
                                </ul>
                            </div>
                        </div>
                    </li>
                  <php>}else{</php>
                <li><a href="{:U('Mob/Question/index',array('mark'=>parentType,'typeId'=>$type['id']))}">{$type.title}</a></li>
               <php>}</php>
            </volist>
        </ul>
    </div>
    <script>
        $(function () {
            $('#Q-list').hide();
            var $type = document.getElementById('Q-list');
            var width=parseInt($('#Q-type').width());
            $type.style.width = width+ 'px';
            $('.Q-list-sec').css("width", width+ 'px');
            $('.Q-list-sec').css("right", (width+10)+ 'px');
            $('#Q-type').click(function () {
                $('#Q-list').toggle();
                if(  $('.Q-list-sec').is(":visible")){
                    $('.Q-list-sec').hide();
                }
                if(  $('.triangle-left').is(":visible")){
                    $('.triangle-left').hide();
                }
            });
            $('#Q-list>ul>li').click(function () {
                if($(this).children('.triangle-left').is(":visible")){
                    $(this).children('.triangle-left').hide();
                    $(this).children('.Q-list-sec').hide();
                }else{
                    $('.triangle-left').hide();
                    $('.Q-list-sec').hide();
                    $(this).children('.triangle-left').show();
                    $(this).children('.Q-list-sec').show();
                }
            });
        });
    </script>
    <div class="question-container">
        <div class="question ulclass">
            <volist name="questionlist" id="vo">
                <include file="_questionlist"/>
            </volist>
        </div>

        <if condition="$pid.count eq 1">
            <div class="am-list-news-ft look-more">
                <a id="getmorequestionlist" data-url="{:U('Mob/Question/addMoreQuestionList')} "
                   data-mark={$mark} data-type-id="{$typeId}">查看更多 &raquo;</a>
            </div>
        </if>
</div>
</block>